package com.ccb.lms.dao;

import java.sql.SQLException;
import java.util.List;

import com.ccb.lms.model.Authority;
import com.ccb.lms.model.Reader;
import com.ccb.lms.util.BasePage;

public interface IAuthorityDAO {
    /**
     * 增加一个权限项目
     * @param authority
     * @return
     * @throws SQLException
     */
	public boolean insertAuthority(Authority authority) throws SQLException;
	/**
	 * 删除一个权限项目
	 * @param authorityNO
	 * @return
	 * @throws SQLException
	 */
	public boolean deleteAuthority(Integer authorityNO) throws SQLException;
	/**
	 * 更新一个权限项目
	 * @param authority
	 * @return
	 * @throws SQLException
	 */
	public boolean updateAuthority(Authority authority) throws SQLException;
	/**
	 * 查询所有权限项
	 * @return
	 * @throws SQLException
	 */
	public List<Authority> getAllAuthorities() throws SQLException; 
	/**
	 * 根据authorityNO查询authority
	 * @param authorityNO
	 * @return
	 * @throws SQLException
	 */
	public Authority getAuthorityByNO(Integer authorityNO) throws SQLException;
	/**获取权限条目数
	 * 
	 * @return
	 * @throws SQLException
	 */
	public int getAuthorityCount() throws SQLException;
	
	/**
	 * 获得页面信息
	 * @param currentPage
	 * @param showRecordNum
	 * @return
	 * @throws SQLException
	 */
	public BasePage getBasePage(int currentPage,int showRecordNum) throws SQLException;
	
	/**
	 * 根据页面确定要显示的记录
	 * @param basePage
	 * @return
	 * @throws SQLException
	 */
	public List<Authority> getAuthorityByPage(BasePage basePage) throws SQLException;
}
